﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using KipmeService;

public partial class Items : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }

    protected override void OnPreRender(EventArgs e)
    {
        string categoryName = Request.QueryString["cat"];
        MainServiceClient service = Application["KipmeWegbservice"] as MainServiceClient;
        if (service == null)
        {
            service = new MainServiceClient();
        }

        product[] products = service.getProductsByCategory(categoryName);
        itemsList.DataSource = products;
        itemsList.DataBind();

        base.OnPreRender(e);
    }
}